import 'package:wanxiang_app/generated/json/base/json_convert_content.dart';
import 'package:wanxiang_app/bean/im_list_entity.dart';

ImListEntity $ImListEntityFromJson(Map<String, dynamic> json) {
  final ImListEntity imListEntity = ImListEntity();
  final int? code = jsonConvert.convert<int>(json['code']);
  if (code != null) {
    imListEntity.code = code;
  }
  final String? msg = jsonConvert.convert<String>(json['msg']);
  if (msg != null) {
    imListEntity.msg = msg;
  }
  final List<ImListData>? data = (json['data'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<ImListData>(e) as ImListData).toList();
  if (data != null) {
    imListEntity.data = data;
  }
  return imListEntity;
}

Map<String, dynamic> $ImListEntityToJson(ImListEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['code'] = entity.code;
  data['msg'] = entity.msg;
  data['data'] = entity.data.map((v) => v.toJson()).toList();
  return data;
}

extension ImListEntityExtension on ImListEntity {
  ImListEntity copyWith({
    int? code,
    String? msg,
    List<ImListData>? data,
  }) {
    return ImListEntity()
      ..code = code ?? this.code
      ..msg = msg ?? this.msg
      ..data = data ?? this.data;
  }
}

ImListData $ImListDataFromJson(Map<String, dynamic> json) {
  final ImListData imListData = ImListData();
  final String? isRest = jsonConvert.convert<String>(json['is_rest']);
  if (isRest != null) {
    imListData.isRest = isRest;
  }
  final String? nickname = jsonConvert.convert<String>(json['nickname']);
  if (nickname != null) {
    imListData.nickname = nickname;
  }
  final String? photo = jsonConvert.convert<String>(json['photo']);
  if (photo != null) {
    imListData.photo = photo;
  }
  final String? account = jsonConvert.convert<String>(json['account']);
  if (account != null) {
    imListData.account = account;
  }
  final String? orderId = jsonConvert.convert<String>(json['order_id']);
  if (orderId != null) {
    imListData.orderId = orderId;
  }
  final String? accountUp = jsonConvert.convert<String>(json['account_up']);
  if (accountUp != null) {
    imListData.accountUp = accountUp;
  }
  final String? accountSc = jsonConvert.convert<String>(json['account_sc']);
  if (accountSc != null) {
    imListData.accountSc = accountSc;
  }
  final String? accountGroup = jsonConvert.convert<String>(
      json['account_group']);
  if (accountGroup != null) {
    imListData.accountGroup = accountGroup;
  }
  final String? games = jsonConvert.convert<String>(json['games']);
  if (games != null) {
    imListData.games = games;
  }
  final String? isBp = jsonConvert.convert<String>(json['is_bp']);
  if (isBp != null) {
    imListData.isBp = isBp;
  }
  return imListData;
}

Map<String, dynamic> $ImListDataToJson(ImListData entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['is_rest'] = entity.isRest;
  data['nickname'] = entity.nickname;
  data['photo'] = entity.photo;
  data['account'] = entity.account;
  data['order_id'] = entity.orderId;
  data['account_up'] = entity.accountUp;
  data['account_sc'] = entity.accountSc;
  data['account_group'] = entity.accountGroup;
  data['games'] = entity.games;
  data['is_bp'] = entity.isBp;
  return data;
}

extension ImListDataExtension on ImListData {
  ImListData copyWith({
    String? isRest,
    String? nickname,
    String? photo,
    String? account,
    String? orderId,
    String? accountUp,
    String? accountSc,
    String? accountGroup,
    String? games,
    String? isBp,
  }) {
    return ImListData()
      ..isRest = isRest ?? this.isRest
      ..nickname = nickname ?? this.nickname
      ..photo = photo ?? this.photo
      ..account = account ?? this.account
      ..orderId = orderId ?? this.orderId
      ..accountUp = accountUp ?? this.accountUp
      ..accountSc = accountSc ?? this.accountSc
      ..accountGroup = accountGroup ?? this.accountGroup
      ..games = games ?? this.games
      ..isBp = isBp ?? this.isBp;
  }
}